package org.springframework.android.showcase.push;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class ReceiveBroadCast extends BroadcastReceiver {

    public static final String TAG = ReceiveBroadCast.class.getSimpleName();
    
    @Override
    public void onReceive(Context context, Intent intent) {
        Log.i(TAG, intent.getAction());
        if (Intent.ACTION_PACKAGE_ADDED.equals(intent.getAction())) {
            // Toast.makeText(context, "有应用被添加", Toast.LENGTH_LONG).show();
        } else if (Intent.ACTION_PACKAGE_REMOVED.equals(intent.getAction())) {
            // Toast.makeText(context, "有应用被删除", Toast.LENGTH_LONG).show();
        } else if (Intent.ACTION_PACKAGE_REPLACED.equals(intent.getAction())) {
            // Toast.makeText(context, "有应用被替换", Toast.LENGTH_LONG).show();
        }
    }
}